//
//  MoCarOrderDetailTableViewCell.m
//  MoCar
//
//  Created by 周小宏 on 2017/5/25.
//  Copyright © 2017年 周小宏. All rights reserved.
//

#import "OrderChooseCell.h"

@interface OrderChooseCell ()

@end

@implementation OrderChooseCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        }
    return self;
}
//创建视图
-(void)creatUI{
    
}
- (void)configCellTypeTitle:(NSString *)typeTitle Model:(id)model {
    
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    
    //种类
    _titleLab = [UILabel new];
    [self.contentView addSubview:_titleLab];
    _titleLab.font = [UIFont systemFontOfSize:15*screenW_6];
    _titleLab.textColor = TextBlack;
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(15 * screenW_6);
        make.top.equalTo(self.contentView).offset(0);
        make.height.equalTo(@(49*screenW_6));
        make.width.equalTo(@(80*screenW_6));
    }];
    
    //箭头
    _arrowImageV = [UIImageView new];
    [self.contentView addSubview:_arrowImageV];
    _arrowImageV.image = [UIImage imageNamed:@"My_arrow"];
    [_arrowImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(18*screenW_6);
        make.height.equalTo(@(14*screenW_6));
        make.width.equalTo(@(8*screenW_6));
        make.right.equalTo(@(-15*screenW_6));
    }];
    
    //种类
    _detailLab = [UILabel new];
    _detailLab.numberOfLines = 0;
    _detailLab.textColor = blueColor;
    _detailLab.font = [UIFont systemFontOfSize:15*screenW_6];
    [self.contentView addSubview:_detailLab];
    [_detailLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLab.mas_right).offset(10 * screenW_6);
        make.right.equalTo(self.arrowImageV.mas_left).offset(-10 * screenW_6);
        make.top.equalTo(self.contentView).offset(10*screenW_6);
        make.height.equalTo(@(29*screenW_6));
        make.bottom.equalTo(self.contentView).offset(-11*screenW_6);
    }];
    
    //画线
    _lineLab = [UILabel new];
    [self.contentView addSubview:_lineLab];
    _lineLab.backgroundColor = LineColor;
    [_lineLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@1);
        make.left.equalTo(@(15*screenW_6));
        make.right.equalTo(@0);
        make.top.equalTo(self.detailLab.mas_bottom).offset(10*screenW_6);
    }];
    

    self.titleLab.text  =  typeTitle;
    self.detailLab.text = @"安安洗车";
    _detailLab.frame = CGRectMake(0, 0, SCREENW-138*screenW_6, 0);
    [_detailLab sizeToFit];
    if (_detailLab.frame.size.height>30*screenW_6) {
        [_detailLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleLab.mas_right).offset(10 * screenW_6);
            make.right.equalTo(self.arrowImageV.mas_left).offset(-10 * screenW_6);
            make.top.equalTo(@(10*screenW_6));
            make.height.equalTo(@(_detailLab.frame.size.height));
            make.bottom.equalTo(self.contentView).offset(-10*screenW_6);
        }];
    }
   
}

@end
